{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第一题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "有一个这样的DNA核酸序列“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”\n",
    "\n",
    "请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "t1=list('AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "a=0\n",
    "g=0\n",
    "c=0\n",
    "t=0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in t1:\n",
    "    if i=='A':\n",
    "        a+=1\n",
    "    elif i=='G':\n",
    "        g+=1\n",
    "    elif i=='C':\n",
    "        c+=1\n",
    "    elif i=='T':\n",
    "        t+=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A有20个，G有17个，C有12个，T有21个\n"
     ]
    }
   ],
   "source": [
    "print('A有%d个，G有%d个，C有%d个，T有%d个'%(a,g,c,t))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第二题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "一个运动员可能得0.50分\n",
      "一个运动员可能得0.75分\n",
      "一个运动员可能得1.00分\n",
      "一个运动员可能得1.25分\n",
      "一个运动员可能得1.50分\n",
      "一个运动员可能得1.75分\n",
      "一个运动员可能得2.00分\n",
      "一个运动员可能得2.25分\n",
      "一个运动员可能得2.50分\n",
      "一个运动员可能得2.75分\n",
      "一个运动员可能得3.00分\n",
      "一个运动员可能得3.25分\n",
      "一个运动员可能得3.50分\n",
      "一个运动员可能得3.75分\n",
      "一个运动员可能得4.00分\n",
      "一个运动员可能得4.25分\n",
      "一个运动员可能得4.50分\n",
      "一个运动员可能得4.75分\n",
      "一个运动员可能得5.00分\n",
      "一个运动员可能得5.25分\n",
      "一个运动员可能得5.50分\n",
      "一个运动员可能得5.75分\n",
      "一个运动员可能得6.00分\n",
      "一个运动员可能得6.25分\n",
      "一个运动员可能得6.50分\n",
      "一个运动员可能得6.75分\n",
      "一个运动员可能得7.00分\n",
      "一个运动员可能得7.25分\n",
      "一个运动员可能得7.50分\n",
      "一个运动员可能得7.75分\n",
      "一个运动员可能得8.00分\n",
      "一个运动员可能得8.25分\n",
      "一个运动员可能得8.50分\n",
      "一个运动员可能得8.75分\n",
      "一个运动员可能得9.00分\n",
      "一个运动员可能得9.25分\n",
      "一个运动员可能得9.50分\n",
      "一个运动员可能得9.75分\n",
      "一个运动员可能得10.00分\n"
     ]
    }
   ],
   "source": [
    "t2=()\n",
    "i=0.25\n",
    "while i<=10:\n",
    "    t2+=(i,)\n",
    "    i=i+0.25\n",
    "for j in t2:\n",
    "    print('一个运动员可能得%.2f分'%j)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第三题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些\n",
    "\n",
    "最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "锅包肉是沈阳的一种美食，它的主要原料是肉\n",
      "大拉皮是东北的一种美食，它的主要原料是粉皮\n"
     ]
    }
   ],
   "source": [
    "t3={'锅包肉':{'城市':'沈阳','原料':'肉'},\n",
    "   '大拉皮':{'城市':'东北','原料':'粉皮'}}\n",
    "for food,temp in t3.items():\n",
    "    print(food+'是'+temp['城市']+'的一种美食，它的主要原料是'+temp['原料'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
